package org.jaaksi.view.filterbar.fragment;

import android.app.Activity;
import android.support.v4.app.Fragment;
import org.jaaksi.view.filterbar.BaseFilterListener;
import org.jaaksi.view.filterbar.FilterBarController;
import org.jaaksi.view.filterbar.FilterBarHandler;

/**
 * Created by Fcy on 2016/5/11.
 */
public class BaseNewHouseListFilterFragment extends Fragment
        implements FilterBarHandler
{

	private BaseFilterListener mFilterListener;
	private FilterBarController mFilterBarController;

	@Override
	public void onAttach(Activity activity)
	{
		super.onAttach(activity);
		if (activity instanceof BaseFilterListener)
		{
			mFilterListener = (BaseFilterListener) activity;
			mFilterBarController = mFilterListener.getFilterBarController();
		}
	}

	@Override
	public void filterAction(int position)
	{
		switch (position) {
			case 1:
				filterAreaAction();
				break;
		}
		mFilterListener.clickFilterBar(position);
	}

	private void filterAreaAction()
	{
		mFilterBarController.updateFilterUI(1, "海淀");
		// TODO listviewsetselection 0，展开区域panel，
	}
}
